﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

class CBigMap
{
    Texture2D texture2D;
    public void Initializing(ContentManager content)
    {
        texture2D = content.Load<Texture2D>(@"Img\bigmap");
    }

    public void Update()
    {
        if ((Keyboard.GetState().IsKeyDown(Keys.Right)) & (cDef.positionMapX > - cDef.MapWidth + cDef.WindowWidth + 15))
        {
            cDef.positionMapX -= 15;
            cDef.positionSpriteX -= 15;
            cDef.exactlyX -= 15;
        }
        if ((Keyboard.GetState().IsKeyDown(Keys.Left)) & (cDef.positionMapX < 0))
        {
            cDef.positionMapX += 15;
            cDef.positionSpriteX += 15;
            cDef.exactlyX += 15;
        }
        if ((Keyboard.GetState().IsKeyDown(Keys.Up)) & (cDef.positionMapY < 0))
        {
            cDef.positionMapY += 15;
            cDef.positionSpriteY += 15;
            cDef.exactlyY += 15;
        }
        if ((Keyboard.GetState().IsKeyDown(Keys.Down)) & (cDef.positionMapY > - cDef.MapHeight + cDef.WindowHeight + 15))
        {
            cDef.positionMapY -= 15;
            cDef.positionSpriteY -= 15;
            cDef.exactlyY -= 15;
        }


    }

    public void Draw(SpriteBatch sb)
    {
        sb.Draw(texture2D, new Vector2(cDef.positionMapX, cDef.positionMapY), Color.White);
    }
}
